import tailwindcss from '@tailwindcss/vite';
import { resolve } from 'path';
import { defineConfig } from 'vite';
import solidPlugin from 'vite-plugin-solid';

export default defineConfig({
  plugins: [solidPlugin(), tailwindcss()],
  server: {
    port: 3000,
    proxy: {
      '^/api': {
        target: 'http://localhost:5000', changeOrigin: true
      }
    }
  },
  build: {
    target: 'esnext',
  },
  resolve: {
    alias: [
      {
        find: '~',
        replacement: resolve(__dirname, 'src')
      }
    ]
  }
});
